Skip to content

docs(react): add RTL Support for the React UI Kit - #647

Open
aanshisingh-cometchat wants to merge 6 commits into
mainfrom
docs/react-uikit-rtl-support
Open

aanshisingh-cometchat wants to merge 6 commits into
mainfrom
docs/react-uikit-rtl-support

Conversation

@aanshisingh-cometchat

@aanshisingh-cometchat aanshisingh-cometchat commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds RTL (right-to-left) support documentation for the React UI Kit v7. It matches the React Native (#645), Android (#627) and Flutter (#622) RTL docs, written the web way (<html dir>, CSS logical properties), and replaces the React half of the earlier combined draft #618.

New page: RTL Support (sidebar: Features, after Campaigns). It covers:

  • Layout direction vs language, and how 'auto' follows the page's <html dir>; CometChatLocalize.getDirection(language) to set it.
  • Turning RTL on for the whole kit: UIKitSettingsBuilder.setLayoutDirection(), <CometChatProvider layoutDirection>, and CometChatUIKit.setLayoutDirection() at runtime (applies to components mounted afterwards; the provider prop re-renders live).
  • The per-component layoutDirection prop ('ltr' | 'rtl'; on Root in the compound API), with the components that take it.
  • Which setting wins when they disagree, and why menus and dialogs follow <html dir> rather than a wrapper's dir.
  • App UI outside the UI Kit.
  • What changes in RTL: layout and overlays, keyboard arrows, the icon rules, what stays left to right (audio/video players, code blocks, AI tool-call JSON, the link URL field, "+N" counts, the Calls SDK's call screen), message text and mentions, the composer and text fields, digits and dates.
  • Custom views in RTL: CSS logical properties, :dir(), and the cometchat-icon--mirror class.
  • Other RTL languages via Localization.

Updated pages:

  • 35 component pages: a "Layout Direction" section with an example and the prop's type and default, plus a layoutDirection entry in Props. Conversations, Users, Groups, Group Members, Message Header, Message List, Message Composer, Thread Header, Pinned Messages, Saved Messages, Message Information, Reactions, Reaction List, Flag Message Dialog, Search, Notification Feed, Call Buttons, Incoming Call, Outgoing Call, Call Logs, AI Assistant Chat, and the Message, Text, Image, Video, Audio, Voice Note, File, Poll, Sticker, Collaborative Document, Collaborative Whiteboard, Call, Call Action and Group Action bubbles.
  • CometChatProvider: layoutDirection prop, a "With Layout Direction" section, the provider tree.
  • Methods: builder setLayoutDirection(), CometChatUIKit.setLayoutDirection() / getLayoutDirection().
  • Localization: Arabic (ar) added (now 20 languages), regional fallback (ar-SA → ar), a note that language and layout direction are separate settings, and a new Count Texts section for the plural count keys (group_member_count_*, last_seen_minutes_ago_*, last_seen_hours_ago_*, thread_reply_count_*, thread_view_reply_count_*) that replace the old keys for those counts. Overview: language count.
  • Troubleshooting: a new RTL Layout section.
  • docs.json: page added to the sidebar. llms-react-v7.mdx: the page link.

The TypeScript examples were type-checked against the UI Kit's RTL branch (uikit-react PR #2456): 0 errors in the examples. The docs match the PR at d3a6e1120, including the call-screen fix and the plural count keys (d95bb7432). The kit PR is now cometchat-team/uikit-react#2467 (merged into dev-v7); e580030 brings the docs up to its head (fa8ace88): old count words, where menus and dialogs render, and the language-direction override.

Related Issue(s)

No GitHub issue. Tracked on Multica:

Type of Change

  • Documentation correction/update
  • New documentation
  • Improvement to existing documentation
  • Typo fix
  • Other (please specify)

Checklist

  • I have read the CONTRIBUTING document
  • My branch name follows the naming convention
  • My changes follow the documentation style guide
  • I have checked for spelling and grammar errors
  • All links in my changes are valid and working
  • My changes are accurately described in this pull request

Additional Information

  • Merge timing: documents @cometchat/chat-uikit-react 7.4.0 (from cometchat-team/uikit-react#2467), which is now on npm, so this can merge.
  • Link check: done with a script, not mint. Every new internal link and #anchor resolves. A mint dev preview hasn't been run yet.
  • useCometChatLayoutDirection is internal in the React kit (unlike React Native), so the custom-view guidance uses CSS (:dir(), logical properties, cometchat-icon--mirror) and getComputedStyle.
  • Replaces the React part of docs(rtl): right-to-left pages for the React and Angular UI Kits #618. The Angular part is in its own PR.

Screenshots (if applicable)

N/A. Text-only changes. RTL screenshots will follow in a separate update.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz

New RTL Support page for the React UI Kit v7: layout direction vs
language, following the page's <html dir> ('auto'), setting it for the
whole kit (UIKitSettingsBuilder.setLayoutDirection, <CometChatProvider
layoutDirection>, CometChatUIKit.setLayoutDirection), the per-component
layoutDirection prop, precedence, what mirrors and what stays LTR,
message and composer text direction, digits and dates, and custom views
with CSS logical properties and the cometchat-icon--mirror class.

Also: a Layout Direction section and a layoutDirection prop entry on 35
component pages, the provider's layoutDirection prop, Methods
(setLayoutDirection on the builder and CometChatUIKit,
getLayoutDirection), Arabic in Localization (20 languages), an RTL
troubleshooting section, the sidebar entry and the LLM index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
@mintlify

mintlify Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
cometchat 🟢 Ready View Preview Dec 1, 2026, 5:29 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

Matches uikit-react PR #2456:
- d3a6e1120: the Calls SDK call screen inside CometChatOngoingCall is always LTR.
- d95bb7432: member, last-seen and thread reply counts use plural keys
  (group_member_count_*, last_seen_minutes_ago_*, last_seen_hours_ago_*,
  thread_reply_count_*, thread_view_reply_count_*). New Count Texts section on
  Localization, and a plural-forms note on RTL Support.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PrajwalDhuleCC PrajwalDhuleCC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this against the React UI Kit at the head of cometchat-team/uikit-react#2467 (fa8ace88, version 7.4.0). The docs were written against d3a6e1120, and the kit has had 35 commits since, so a few statements are now out of date (inline).

These match the kit:

  • setLayoutDirection() on the builder, CometChatUIKit.setLayoutDirection() and getLayoutDirection(), and init() applying the builder's value every time.
  • The provider prop winning over the builder and the runtime setter, including when it's "auto".
  • The getDirection() wording, including the no-argument case.
  • Which components take the prop, including CometChatVoiceNoteBubble passing it to the audio bubble; the Card and Delete bubbles don't take it.
  • The "Count Texts" table against the en-us strings, the Arabic forms, and the fallback to _other.
  • The global cometchat-icon--mirror rule.
  • The new anchor links resolve.

Outside the inline notes:

  • Nit: 7.4.0 adds other translation keys the Localization page doesn't list: typing_indicator_typing, typing_indicator_others, file_size_b/_kb/_mb/_gb and audio_bubble_loading.
  • The description still points to uikit-react PR #2456; the kit PR is now cometchat-team/uikit-react#2467.
  • As the description says, this should merge only once 7.4.0 is on npm. The latest there is now 7.3.0, not 7.2.6 as the description says.

I checked these by reading the kit's code, not by running it. Please verify each point yourself.

Comment thread ui-kit/react/localization.mdx Resolved
Comment thread ui-kit/react/rtl-support.mdx Resolved
Comment thread ui-kit/react/troubleshooting.mdx Resolved
…ider root

Addresses Prajwal's review on #647:
- Localization: an override of an old count word still applies until the new
  plural key is overridden (08b51be8f); list the other keys 7.4.0 adds
  (typing_indicator_*, file_size_*, audio_bubble_loading).
- RTL support / troubleshooting: menus and dialogs render in the
  CometChatProvider's root element, so dir around the whole provider works.
- Troubleshooting: the --cometchat-language-direction override needs
  .cometchat[data-cometchat-language-direction] to beat the kit's own rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
@aanshisingh-cometchat

Copy link
Copy Markdown
Contributor Author

@PrajwalDhuleCC Thanks. The three inline points are fixed in e580030 and replied to on their threads. The nit is done too: Localization has a short "Other Texts Added in 7.4.0" table for typing_indicator_typing, typing_indicator_others, file_size_b/_kb/_mb/_gb and audio_bubble_loading, with the en-us strings. The description now points to cometchat-team/uikit-react#2467 and says npm is at 7.3.0. This still merges only once 7.4.0 is on npm.

Navigation only; the page URL is unchanged, so no redirect is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz

@ashfaqcometchat ashfaqcometchat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 41823d1d against the published @cometchat/chat-uikit-react 7.4.0 (on npm since today, so the merge-timing note in the description no longer blocks).

No build, redirect or link problems: 0 dangling nav refs, 0 broken internal links, all new anchors resolve. The documented API (setLayoutDirection, getLayoutDirection, getDirection, the CometChatProvider prop, CometChatLayoutDirection, the plural count keys, the 7.4.0 text keys, cometchat-icon--mirror, --cometchat-language-direction) matches the package, and every component listed as taking layoutDirection has the prop in 7.4.0.

Minor fixes:

  • Overview contradicts itself: ui-kit/react/overview.mdx:68 still says "19 supported languages"; the table in the same page now says 20.
  • CSS example: see the inline comment.
  • Description is out of date: it says "sidebar: Customization, after Localization", but the last commit moved the page to the Features group; it also says 7.4.0 is not published.

Comment thread ui-kit/react/rtl-support.mdx Resolved
Addresses Ashfaq's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrArYcnTWam26CSxAdeZrz
@aanshisingh-cometchat

Copy link
Copy Markdown
Contributor Author

@ashfaqcometchat Thanks. All three are fixed:

  • CSS example: fixed in 8038dd0, and replied to on the thread.
  • Language count: overview.mdx:68 now says 20 languages, matching the table.
  • Description: now says the page is under Features, after Campaigns, and that 7.4.0 is on npm, so this can merge.

@ashfaqcometchat ashfaqcometchat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at 8038dd0c: all findings from my earlier review are fixed. Approving.

This branch was successfully deployed

1 active deployment
staging — 8038dd0c Deployed Dec 1, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants